<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <div id="app">
    <!-- 
      v-if,v-show都是条件为true显示元素
      
      v-if隐藏时,代码直接被隐藏
      v-show隐藏时，通过display:none,控制页面元素显示
    -->
    <button @click='show = !show'>click</button>
    <h1 v-if='show'>if = see</h1>
    <h1 v-show='show'>show = see</h1>
  </div>
  <script src="/node_modules/vue/dist/vue.js"></script>
  <script>
    new Vue({
      el: '#app',
      data() {
        return {
          show: true
        }
      }
    })
  </script>
</body>

</html>